/**
 * 21/02/2014
 * 
 * Sale
 */
package org.cuatrovientos.erp.model;

import java.sql.Timestamp;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;

/**
 * Pojo class. Model of Sale.
 * @author Javier Tejedor
 */
public class Sale {
	
	@Size(min=1,message="{sale.id.error}")
	private int id;
	
	@NotNull
	@Size(min=1,max=50,message="{sale.name.error}")
	private String name;
	
	@Past(message="{sale.date.error}")
	private Timestamp date;
	
	@NotNull
	@Size(min=1,message="{sale.idemployee.error}")
	private int idEmployee;
	
	/**
	 * Constructor
	 */
	public Sale(){
		
	}

	/**
	 * @param id
	 * @param name
	 * @param date
	 * @param idEmployee
	 */
	public Sale(int id, String name, Timestamp date, int idEmployee) {
		super();
		this.id = id;
		this.name = name;
		this.date = date;
		this.idEmployee = idEmployee;
	}



	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Timestamp getDate() {
		return date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	public int getIdEmployee() {
		return idEmployee;
	}

	public void setIdEmployee(int idEmployee) {
		this.idEmployee = idEmployee;
	}

	@Override
	public String toString() {
		return "Sale [id=" + id + ", name=" + name + ", date=" + date
				+ ", idEmployee=" + idEmployee + "]";
	}
	
}
